home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2002 January / maximum-cd-2002-01.iso / Files / Mechwarrior 4 Mapping / MW4Editor.exe / content / ABLScripts / StockScripts / Stock_DestroyObjective.ABL < prev    next >
Encoding:
Text File  |  2001-07-16  |  687 b   |  47 lines

  1. fsm StockDestroyObjective : integer;        
  2.  
  3.     const
  4.         #include_ <content\ABLScripts\mwconst.abi>
  5.  
  6.     type
  7.         #include_ <content\ABLScripts\mwtype.abi>
  8.  
  9.     var
  10.         static ObjectID        objective;
  11.  
  12. function CheckIfObjectiveDestroyed(ObjectID obj) : integer;
  13.     var
  14.         ObjectID who_killed;
  15.  
  16.     code
  17.         if (obj <> -1) then
  18.             if (IsDead(obj) == true) then
  19.                 who_killed = WhoDestroyed(obj);
  20.                 
  21.                 // TODO: objective dead
  22.             endif;
  23.         endif;
  24.  
  25. endfunction;
  26.  
  27. function init;
  28.     code
  29.         objective = -1;
  30.  
  31.         SetupScoring_DestroyObjective;
  32. endfunction;
  33.  
  34. state startState;
  35.     code
  36.         CheckIfObjectiveDestroyed(objective);
  37.  
  38. endstate;
  39.  
  40. state deadState;
  41.     code
  42.  
  43. endstate;
  44.     
  45. endfsm.
  46.  
  47.